﻿@model IEnumerable<WeProjectsModel.Document>

@{
    ViewBag.Title = "Files";
    int usrId = int.Parse(Membership.GetUser().ProviderUserKey.ToString());
    var menuId = Request.QueryString["projectId"];
    }

<div style="text-align:center">
    @Html.ActionLink("进度", "../Project/Details", new { id = menuId })
    @Html.ActionLink("文件", "../Project/Files", new { id = menuId })
    @Html.ActionLink("公告", "../Project/News", new { id = menuId })
    @Html.ActionLink("成员", "../Project/Member", new { id = menuId })
</div>

<h2>从文档库中选择</h2>
@using (Html.BeginForm("Upload", "Task")) { 
    <input type="hidden" name="projectId" value=@Request.QueryString["projectId"] />
    <input type="hidden" name="taskId" value=@Request.QueryString["taskId"] />
<table class="gridtable">
    <tr>
        <th></th>
        <th>
            文件名
        </th>
        <th>
            大小KB
        </th>
        <th>
            上传时间
        </th>
        <th>
            上传者
        </th>
    <th>
        子项目
    </th>
        <th>关联者</th>
        <th></th>
    </tr>  
    @foreach (var item in Model)
    {
        <tr>
            <td>
                <input type="checkbox" name="chkfile" id="fileid" value="@item.ID" />
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Size)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UploadDateTime)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Member.DisplayName)
            </td>
    <td>
        @Html.DisplayFor(modelItem => item.Project.Title)
    </td>
            <td>关联者</td>
                <td>
                @*@Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                @Html.ActionLink("Details", "Details", new { id = item.ID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ID })*@
            </td>
        </tr>
    }
</table>
    <input type="button" name="checkall" id="checkall" value="全选"/>
    <input type="button" name="checkdel" id="checkdel" value="取消全选"/>
    <input type="submit" name="Submit" id="Submit" value="提交" />
    @*<script src="~/Scripts/jquery-1.9.0.js"></script>*@
    <script type="text/javascript">
    $(function() {
        $("#checkall").click(function() {
            $("[type='checkbox']").attr("checked",true);
        });
        $("#checkdel").click(function () {
            $("[type='checkbox']").attr("checked",false);
        });
    });
</script>
}

